A=[0 1 5 -4; 1 4 3 -2; 2 7 1 -2];
aux=A(1,:); A(1,:)=A(2,:); A(2,:)=aux;
A(3,:)=A(3,:)-2*A(1,:);
A(3,:)=A(3,:)+A(2,:);
A